<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
    {include file="overtime/authority_tab"}
    <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;border:0">
        <form class="layui-form serch" action="{:url('admin/overtime/authorityList')}" method="post">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="apply_username" placeholder="申请人姓名模糊搜索" name="apply_username">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layui-btn-sm layui-btn" lay-submit="" lay-filter="serch">点击查询</button>
                </div>
            </div>
        </form>

    </fieldset>
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th><span style="font-weight: bold">申请人</span></th>
            <th><span style="font-weight: bold">申请人所在部门</span></th>
            <th><span style="font-weight: bold">加班申请总时长</span></th>
            <th><span style="font-weight: bold">调休申请总时长</span></th>
            <th><span style="font-weight: bold">已批准加班时长</span></th>
            <th><span style="font-weight: bold">已使用加班时长</span></th>
            <th><span style="font-weight: bold">未使用加班时长</span></th>
            <th><span style="font-weight: bold">已批准调休时长</span></th>
        </tr>
        </thead>
        <tbody>
        {volist name="myList" id="vo"}
        <tr>
            <td>{$vo.apply_name}</td>
            <td>{$vo.cate_name}</td>
            <td><span style="font-weight: bold;color: #00B83F">{$vo.overtime_all}</span></td>
            <td><span style="font-weight: bold; color: red">{$vo.application_all}</span></td>
            <td>{$vo.overtime_allow_all}</td>
            <td>{$vo.overtime_used}</td>
            <td>{$vo.overtime_available}</td>
            <td>{$vo.application_allow_all}</td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div style="padding:0 20px;">{$myList->render()}</div>

    <script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    <script>
        var message;
        layui.config({
            base: '__JS__/',
            version: '1.0.1'
        }).use(['app', 'message'], function() {
            var app = layui.app,
                $ = layui.jquery,
                layer = layui.layer;
            //将message设置为全局以便子页面调用
            message = layui.message;
            //主入口
            app.set({
                type: 'iframe'
            }).init();
        });
    </script>
    <script type="text/javascript">
        $(function(){
            var x = 10;
            var y = 20;
            $(".tooltip").mouseover(function(e){
                var tooltip = "<div id='tooltip'><img src='"+ this.href +"' alt='预览图' height='200'/>"+"<\/div>"; //创建 div 元素
                $("body").append(tooltip);  //把它追加到文档中
                $("#tooltip")
                    .css({
                        "top": (e.pageY+y) + "px",
                        "left":  (e.pageX+x)  + "px"
                    }).show("fast");    //设置x坐标和y坐标，并且显示
            }).mouseout(function(){
                $("#tooltip").remove();  //移除
            }).mousemove(function(e){
                $("#tooltip")
                    .css({
                        "top": (e.pageY+y) + "px",
                        "left":  (e.pageX+x)  + "px"
                    });
            });
        })

        $('.delete').click(function(){
            var id = $(this).attr('id');
            layer.confirm('确定要删除?', function(index) {
                $.ajax({
                    url:"{:url('admin/attachment/delete')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                location.href = res.url;
                            },1500)
                        }
                    }
                })
            })
        })
    </script>
    <script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            //常规用法
            laydate.render({
                elem: '#create_time'
            });
            laydate.render({
                elem: '#end_time'
            });
        });
    </script>
</div>
</body>
</html>
